<?php

namespace app\common\controller;

use think\Controller;
use think\Request;

class FileController extends Controller
{
    public static function UploadEvent($files, $size = 2067800, $ext = 'jpg,png,gif', $path = 'uploads')
    {
        $info = $files->validate(['size' => $size, 'ext' => $ext])->move($path);
        return [
            'status' => $info ? true : false,
            'data' => $info ? $info->getPathname() : $files->getError()
        ];
    }
}
